<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>客户情况分析</title>
  <#assign base=request.contextPath  />
    <base id="basePath" href="${base}">

    <base id="basePath" href="${base}">
    <link rel="stylesheet" href="${base}/css/demo.css" type="text/css">
    <link rel="stylesheet" href="${base}/css/zTreeStyle.css" type="text/css">
    <script type="text/javascript" src="${base}/js/ztree/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="${base}/js/ztree/jquery.ztree.core.js"></script>
    <script type="text/javascript" src="${base}/js/zhang.js"></script>
    <script type="text/javascript" src="${base}/js/ztree/jquery.ztree.excheck.js"></script>
    <script type="text/javascript" src="${base}/js/ztree/jquery.ztree.exedit.js"></script>

    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${base}/js/layui/css/layui.css" media="all">
</head>
<style type="text/css">
    form{
        padding: 20px;
    }
    .layui-btn-radius{
        border-radius: 5px;
    }
</style>
<body>
<fieldset class="layui-elem-field layui-field-title"  >
    <legend>销售统计</legend>
</fieldset>
<div class="demoTable" style="height:40px;padding:15px;">
    <div class="layui-inline layui-form" style="float:right;">
        <div class="layui-input-inline">
            <select name="interest"  id="sech"  lay-search="">
                <option value="">请选择要搜索的列</option>
                <option value="sname">姓名</option>
                <option value="name">套餐</option>
                <option value="consumption">后续消费</option>
                <!--<option value="visit">拜访次数</option>-->
                <!--<option value="follow">跟进次数</option>-->
                <!--<option value="consumption">后续消费</option>-->
                <!--<option value="whether">是否转介绍</option>-->
                <option value="person">录入人</option>
                <option value="dept">部门</option>
            </select>
        </div>

        <div class="layui-inline">
            <input class="layui-input" name="id" id="demoReload" autocomplete="off">
        </div>
        <button class="layui-btn layui-btn-radius" id="btn1" data-type="reload" style="background-color: #0092EF;">搜索</button>
    </div>
</div>





<table class="layui-hide" id="test" lay-filter="test"></table>


<script src="${base}/js/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'layedit', 'laydate','table'], function(){
        var form = layui.form
                ,$ = layui.jquery
                ,layer = layui.layer
                ,layedit = layui.layedit
                ,laydate = layui.laydate
        table = layui.table;
        table.render({
            elem: '#test'
            ,url:'${base}/situationAnalysis/selectSituationAnalysis'
            ,toolbar: '#toolbarDemo'
            ,defaultToolbar: ['filter', 'print', 'exports']
            ,totalRow: true
            ,cols: [[
                {field:'customerId', title: 'ID',templet:function(val){
                        return val.LAY_INDEX
                    },width:70, field: true}
                ,{field:'sname', width:150, title: '姓名',align:'center'}
                ,{field:'mealName',width:240, title: '套餐',align:'center'}
                ,{field:'consumption',width:240, title: '后续消费',align:'center'}

                //,{field:'visit', width:170, title: '拜访次数',align:'center'}
                //,{field:'follow',width:160, title: '跟进次数',align:'center'}
                //,{field:'consumption', width:220, title: '后续消费',align:'center'}
                //,{field:'whether',width:200, title: '是否转介绍',align:'center'}
                ,{field:'person',width:200, title: '录入人',align:'center'}
                ,{field:'dept',width:130, title: '部门',align:'center'}
                ,{field:'date',width:250,templet:function(val){
                        return DateFormat(val.date);
                    }, title: '日期',align:'center'}
            ]]
            ,id:'testReload'
            ,page: {
                layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
                ,theme: '#0092EF'
                ,limit:20
            }
            ,height:500

        });

        //实现搜索
        layui.form.on('select()', function(data){
            $("#demoReload").val("")
        });



//实现搜索
        $('#btn1').on('click', function(){
            var sechLin=$("#sech").val();
            var sechData=$("#demoReload").val();

            var whereData={};
            whereData.lin=sechLin;
            whereData.data=Trim(sechData);
            whereData.page=1;
            whereData.limt=10;
            whereData.page=1;
            whereData.limit=10;
            var table = layui.table;
            //表刷新方法
            table.reload('testReload', {
                url:'${base}/situationAnalysis/selectSituationAnalysis'
                ,where: whereData //设定异步数据接口的额外参数
            });
        });
        String.prototype.trim = function() {
            return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
        }





    });








</script>

</body>
</html>